@echo off
REM ========================================
REM 快速 Git 更新推送
REM Quick Git Update and Push
REM ========================================

chcp 65001 > nul

echo.
echo ========================================
echo Git 快速更新推送
echo Git Quick Update and Push
echo ========================================
echo.

REM 显示当前状态
echo [状态检查 / Status Check]
echo.
git status
echo.

REM 询问提交信息
set /p commit_msg="请输入提交说明 / Enter commit message (留空使用默认): "

if "%commit_msg%"=="" (
    set commit_msg=Update: %date% %time%
)

echo.
echo ========================================
echo 将执行以下操作 / Will perform:
echo   1. git add .
echo   2. git commit -m "%commit_msg%"
echo   3. git push
echo ========================================
echo.

pause

echo.
echo [1/3] 添加文件 / Adding files...
git add .

echo.
echo [2/3] 提交更改 / Committing changes...
git commit -m "%commit_msg%"

echo.
echo [3/3] 推送到远程 / Pushing to remote...
git push

if %errorlevel% equ 0 (
    echo.
    echo ========================================
    echo ✓ 推送成功！
    echo ✓ Push successful!
    echo ========================================
    echo.
    echo 查看您的仓库 / View your repository:
    echo https://gitee.com/zhang-zezheng123/KeyBoard
) else (
    echo.
    echo ========================================
    echo ✗ 推送失败
    echo ✗ Push failed
    echo ========================================
    echo.
    echo 请检查：/ Please check:
    echo   1. 网络连接 / Network connection
    echo   2. 用户名密码 / Username and password
    echo   3. 远程仓库状态 / Remote repository status
)

echo.
pause


